﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class data : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        if (fldDataFile.PostedFile.FileName == null)
        {
            cvUpload.ErrorMessage = "Please select the xml data file to upload";
            cvUpload.IsValid = false;
            return;
        }
        string xmlFileName = Server.MapPath("Automations.xml");
        fldDataFile.PostedFile.SaveAs(xmlFileName);
    }
    protected void btnReset_Click(object sender, EventArgs e)
    {
        File.Delete(MapPath("Automations.xml"));
        File.Copy(MapPath("AutomationsBK.xml"), MapPath("Automations.xml"));
    }
}
